home *** CD-ROM | disk | FTP | other *** search
/ Internet Surfer: Getting Started / Internet Surfer - Getting Started (Wayzata Technology)(7231)(1995).bin / pc / mac / bonus / peter_le / talk_sou / my_libra / myhandle.uni < prev    next >
Text File  |  1992-04-20  |  1KB  |  57 lines

  1. unit MyHandleQuitBoth;
  2.  
  3. { This program was written by Peter N Lewis, Mar 1992 in THINK Pascal 4.0.1 }
  4.  
  5. interface
  6.  
  7.     procedure InitQuitBoth (creator: OSType);
  8.     procedure FinishQuitBoth;
  9.  
  10. implementation
  11.  
  12.     uses
  13.         BaseGlobals, MySystem7, MyFMenus, AppGlobals;
  14.  
  15.     var
  16.         quitBoth: boolean;
  17.         creatorType: OSType;
  18.  
  19.     procedure DoQuit;
  20.     begin
  21.         quitNow := true;
  22.         if quitBoth then
  23.             QuitApplication(creatorType);
  24.     end;
  25.  
  26.     procedure SetQuit (themenu, theitem: integer);
  27.         var
  28.             dummyb: boolean;
  29.             er: eventRecord;
  30.             nqb: boolean;
  31.             process: processSerialNumber;
  32.             s: str255;
  33.     begin
  34.         dummyb := GetOSEvent(0, er);
  35.         nqb := (BAND(er.modifiers, optionKey) <> 0) & GetPSN(creatorType, process);
  36.         if nqb <> quitBoth then begin
  37.             quitBoth := nqb;
  38.             if quitBoth then
  39.                 GetIndString(s, quitBothStrhID, quitBothQuitBothStrhIndex)
  40.             else
  41.                 GetIndString(s, quitBothStrhID, quitBothQuitStrhIndex);
  42.             SetItem(GetMHandle(themenu), theitem, s);
  43.         end;
  44.     end;
  45.  
  46.     procedure InitQuitBoth (creator: OSType);
  47.     begin
  48.         quitBoth := false;
  49.         creatorType := creator;
  50.         SetFBoth(CQuit, @DoQuit, @SetQuit);
  51.     end;
  52.  
  53.     procedure FinishQuitBoth;
  54.     begin
  55.     end;
  56.  
  57. end.